The data card is a type of plug-and-play universal serial bus (USB) device, which supports different types of OSs (such as Windows® and Mac® OS) or different versions of the same type of OS (such as Windows XP® or Windows 7®). Due to the difference between different types of OSs and the difference between different versions of OSs, different parameters need to be set for the data card according to different OSs. Therefore, it is necessary for the data card to obtain the type and version of the current OS. However, currently, the interface protocol for the USB device does not define such an interface. Consequently, the data card cannot easily obtain the type and version of the current OS.
The prior art provides a method for identifying the OS. The method includes as follows: The data card first sets a working port to a specific port in non-working mode; the OS loads the user-defined driver program to the port and sends to the data card a message, which contains information about the OS type and version, by using the driver program; the data card determines the OS type and version according to this message, cancels the setting of the specific port in non-working mode, sets parameters for the working port according to the OS type and version, and reports the information about the working port. Subsequently, data can be transmitted between the data card and OS.
The prior art has the following disadvantages:
In the prior art, by using dedicated driver programs developed for the port in non-working mode, the message, which contains information about the OS type and version, can be sent to the data card. Because there are many types of OSs and there are different versions for the same type of OS, multiple driver programs need to be developed, which is complex and consumes much manpower.